package Vista;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import javax.swing.WindowConstants;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaTablaPosiciones extends javax.swing.JFrame {
	private JPanel jpanPosiciones;
	private JLabel lbltablaPosiciones;
	private JTable jTblistado;
	private JScrollPane jScposiciones;

	/**
	* Auto-generated main method to display this JFrame
	*/
	
	
	public VentanaTablaPosiciones() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jpanPosiciones = new JPanel();
				getContentPane().add(jpanPosiciones, BorderLayout.CENTER);
				jpanPosiciones.setLayout(null);
				jpanPosiciones.setSize(1400, 400);
				jpanPosiciones.setBackground(new java.awt.Color(197,229,249));
				{
					lbltablaPosiciones = new JLabel();
					jpanPosiciones.add(lbltablaPosiciones);
					lbltablaPosiciones.setText("TABLA DE POSICIONES");
					lbltablaPosiciones.setBounds(265, 12, 246, 33);
					lbltablaPosiciones.setFont(new java.awt.Font("Bitstream Charter",0,20));
				}

				{
					jScposiciones = new JScrollPane();
					jpanPosiciones.add(jScposiciones);
					jScposiciones.setBounds(53, 51, 715, 258);
					jScposiciones.setBackground(new java.awt.Color(197,229,249));
					{
						
						jTblistado = new JTable();
						jScposiciones.setViewportView(jTblistado);
					}
				}
			}
			pack();
			setSize(800, 400);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public void setListado (AbstractTableModel abstractTableModel){
		
		jTblistado.setModel(abstractTableModel);
		
	}
	
	public void mostrarMensaje (String mensaje){
		
		JOptionPane.showMessageDialog(this, mensaje);
	}
	
}
